#include <string>
#include <iostream>
#include <ctime>
#include <conio.h>
#include "OrderObject.h"


using namespace std;
#pragma once


// class Card prototype -----------------------
class Card
{
public:
	enum State {deleted, active}; // not bool because later we'll expand
	enum Suit { clubs, diamonds, hearts, spades };

	// for sort
private:  
	static char valueRanks[14];  // 13 + 'X' for Joker
	static Card::Suit suitRanks[4];
	static int numValsInOrderingArray;  // up to 14 (possible 'X' = Joker)


private:
	char value;
	Suit suit;
	State state;
	bool errorFlag;

public:
	
	Card(char value = 'A', Suit suit = spades);
	string toString();
	bool set(char value = 'A', Suit suit = spades);
	void setState(State state);

	char getVal();
	Suit getSuit();
	State getState();
	bool getErrorFlag();
	bool equals(Card card);

	// sort members and methods
public:
	int compareTo(Card &other);
	static void setRankingOrder( char valueOrderArr[], Suit suitOrdeArr[], int numCardsInOrderingArray);
	static int getSuitRank(Suit st);
	static int getValueRank(char val);
	static void arraySort(Card array[], int arraySize);

private:
	// sort helpers
	static bool floatLargestToTop(Card array[], int top);
	static void swap(Card &a, Card &b);

};



